package Invaders;

import java.awt.Dimension;
import javax.swing.ImageIcon;

public class InvaderVertical extends Invader{
	
	public InvaderVertical(Dimension a) {
		super(a);
		icon = new ImageIcon(getClass().getResource("/Sprites/invadergreen.gif")).getImage();
		score = 5;
		life = 1;
	}

	public void move() {
	    if (estaAtivo) {
	    	y += dy;
			if (x < 0) { 
				dx = -dx; 
				x += dx; 
			} 
			if (y < 0) { 
				dy = -dy; 
				y += dy; 
			} 
			if (x > area.width-iw) { 
				dx = -dx; 
				x += dx; 
			} 
			if (y > area.height-ih) { 
				dy = -dy; 
				y += dy; 
			}
			//if (y > area.height-100-ih/2) { dy = -dy; y += dy; }
	    }
    }
}
